import Vue from 'vue'
import App from './App'
import router from './router/router'
import vant from 'vant'
import axios from 'axios'

//引入vue的动画css文件
import '@/css/animate.css'
//引人vant的css文件
import 'vant/lib/index.css'
//引入权限文件
import './premission'

axios.defaults.baseURL = 'http://111.230.181.206:3000'
Vue.prototype.$axios = axios
//把axios放在vue的原型上
// Vue.prototype.$axios = axios
Vue.prototype.$fixImgUrl = function (url) {
  let res = ''
  if (url.indexOf('http') < 0) {
    res = axios.defaults.baseURL + url
  } else {
    res = url
  }
  return res
}

//使用vant组件
Vue.use(vant)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
